#include <stdio.h>
#include <math.h>

int main() {
    int n = 1, sign = -1;
    float sum = 0.0, this = 0.0;

    do {
        sum += this;

        sign *= -1;
        this = sign * 1.0 / (2 * n -1);
        n ++;
    } while(fabs(this) > 1e-6);
    printf("pi / 4: %f\n", sum);
    return 0;
}
